package com.bdd.controller;

import com.bdd.Result.Result;
import com.bdd.model.bo.ReturnItemBO;
import com.bdd.model.bo.clothing.ClothingForOrderItemBO;
import com.bdd.service.OrderItemService;
import com.bdd.service.ReturnItemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/returnItem")
@Api(value = "退货项管理")
public class ReturnItemController {

    @Autowired
    ReturnItemService returnItemService;

    @GetMapping("/list")
    @ApiOperation("退货项查找")
    @RequiresRoles(value = {"STAFF", "ADMIN"}, logical = Logical.OR)
    @ResponseBody
    public Result<List<ReturnItemBO>> list(Integer returnId) {
        List<ReturnItemBO> returnItemBOList = returnItemService.list(returnId);
        return Result.ok(returnItemBOList);
    }
}
